<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>加入购物车动画效果</title>
    <style>
        .ball {
            margin-top:300px;
            margin-left:300px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background-color: red;
       
            animation: moveX 2s linear forwards;
      
        }

        .inner {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background-color: green;
            animation: moveY 2s cubic-bezier(0.5,-1, 1,1) forwards;
        }

        @keyframes moveX {
            to {
                transform: translateX(200pX);
            }
        }
        @keyframes moveY {
            to {
                transform: translateY(400px);
            }
        }
    </style>
</head>

<body>
    <div class="ball">
        <div class="inner"></div>
    </div>
</body>

</html>